<!DOCTYPE html>
<html>
<head>
<title>报名</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<link rel="stylesheet" href="../addons/haoman_dpm/mobimg/index.css?v=20161124170424" />
<style type="text/css" id="_zoom"></style>
<style type="text/css">
	.wrapper {
        width: 100%;
        max-width: 800px;
        min-height: 100%;
        margin: 0 auto;
        background-image: url({$bg});
        background-repeat: repeat;
        background-size: 100% auto;
    }
</style>
	<style>

		.tel_cover{

			position: fixed;

			width: 100%;

			height: 100%;

			background: rgba(0,0,0,.8);

			left: 0;

			top: 0;

			z-index: 9999;

			display: block;

		}

		.tel_content{

			width: 80%;
			min-height: 320px;
			background: white;

			border-radius: 5px;

			margin-left: 10%;

			padding: 50px 0;

			margin-top: 35%;

			text-align: center;
		}

		.tel_content_title{

			font-size: 2rem;

			padding: 10px 0 30px 10px;

		}

		.tel_content_input{

			margin-bottom: 25px;

			width: 100%;
			font-size: 16px;
			font-weight: bold;
		}
		.tel_content_input label{

			width: 30%;

			display: inline-block;

			text-align: center;

			padding: 5px 0;

			font-size: 1.6rem;
		}

		.tel_content_btn{
			border: 0;
			width: 40%;
			height: 80px;
			line-height: 80px;
			border-radius: 5px;
			background: orange;
			color: white;
			font-size: 1.6rem;
			margin-top: 15px;
		}
		.tel_content_btns{
			border: 0;
			width: 40%;
			height: 80px;
			line-height: 80px;
			border-radius: 5px;
			background: #e1e1e1;
			color: #333;
			font-size: 1.6rem;
			margin-top: 15px;
		}
		.disabled{

			background: gray !important;

		}

	</style>
</head>
<body>
<div id="container">
<div class="zoom">
<div class="cover"></div>

<div class="error_dialog">
  <img alt="" src="../addons/haoman_dpm/mobimg/error.png">
  <p>还有信息没有填写完哦！</p>
</div>

	<div class="tel_cover" style="display: none">

		<div class="tel_content">

			<div class='tel_content_title'>本次报名需要支付费用</div>

			<div class="tel_content_input">
				<label>报名费：</label><span style="color: red;font-size: 1.6rem;">{php echo $reply['isbaoming_paymoney']/100}</span><span style="font-size: 1.6rem;">元</span>
			</div>

			<div style="text-align: center;">
				<button class="tel_content_btns" onclick="onChecks()">取消</button>
				<button class="tel_content_btn" onclick="onCheck()">提交</button>
			</div>
			<input type="hidden" value="" id="token">

		</div>

	</div>

<div class="signIned">
   <div class="success"><s></s>报名成功</div>
   <a href="javascript:void(0);" onclick="is_close()" class="yellow_btn">确定</a>
</div>	
	<div class="wrapper">
	   
	    <div class="companyName" style="padding-top: 20%;">
	      <p>欢迎参加</p>
	      <p>{$reply['mobtitle']}</p>
	    </div>
	    {if $reply['ziliao']==1}
	    <div class="signIn1" >
			<div class="head_box">
			  <div class="headbox"><img alt="" src="../addons/haoman_dpm/mobimg/headbox.png"></div>
				<img alt="" src="{php echo tomedia($avatar)}" />
				{if $xysreply['is_pair']==0}
				{if $sex==1}<img src="../addons/haoman_dpm/img12/man.png" class="man seximg" style="width: 60px;height: 60px;position: absolute;top:150px;right: 5px;z-index: 9999;">
				{else}<img src="../addons/haoman_dpm/img12/woman.png" class="woman seximg" style="width: 60px;height: 60px;position: absolute;top:150px;right: 5px;z-index: 9999;">{/if}
				<input type="hidden" value="{$sex}" class="sex" name="sex">
				<input type="hidden" value="0" class="tokens" name="tokens">
				{/if}
			</div>
			<div class="userName">{$nickname}</div>
			<a href="javascript:void(0);" class="yellow_btn signin-btn">报名</a>
		</div>
		{else}
		<div class="signIn2">
		    <div class="head_box">
			  <div class="headbox"><img alt="" src="../addons/haoman_dpm/mobimg/headbox.png"></div>
				<img alt="" src="{php echo tomedia($avatar)}" />
				{if $xysreply['is_pair']==0}
				{if $sex==1}<img src="../addons/haoman_dpm/img12/man.png" class="man seximg" style="width: 60px;height: 60px;position: absolute;top:150px;right: 5px;z-index: 9999;">
				{else}<img src="../addons/haoman_dpm/img12/woman.png" class="woman seximg" style="width: 60px;height: 60px;position: absolute;top:150px;right:  5px;z-index: 9999;">{/if}
				<input type="hidden" value="{$sex}" class="sex" name="sex">
				<input type="hidden" value="0" class="tokens" name="tokens">
				{/if}
			</div>
			 
			  <p>请输入您的相关信息，完成报名。</p>
			  <section id="markname1" ><s class="s1"></s><span class="b_top"></span><span class="b_bottom"></span><input type="text" class="nickname" name="realname" id="realname" placeholder="姓名"></section>
				
				{if $reply['ziliao']==2 || $reply['ziliao']==3} <section id="markname2" ><s class="s2"></s><span class="b_top"></span><span class="b_bottom"></span><input type="tel" class="telphone" name="mobile" id="mobile" placeholder="手机号"></section>{/if}
				
				{if $reply['ziliao']==3}<section id="markname4"><s class="s4"></s><span class="b_top"></span><span class="b_bottom"></span><input type="text" class="company" name="address" id="address" placeholder="公司名称/职位"></section>{/if}
				
				<section><a href="javascript:;" class="yellow_btn signin-btn">报名</a>
				<section style="width:100%;height:20px;"></section>
		</div>
		{/if}
		
	</div>
</div>
<script type="text/javascript" src="../addons/haoman_base/base/zepto.min.js?v=20161124170424"></script>
	<script type="text/javascript" src="../addons/haoman_dpm/mobimg/index.js?v=20161124170424"></script>
	<script>
		$(".seximg").click(function(){
			{if $is_sex !=1}{return}{/if}
			if($(this).attr("src") == "../addons/haoman_dpm/img12/man.png"){
				$(this).attr("src",'../addons/haoman_dpm/img12/woman.png');
				$(".sex").val("2")
                $(".tokens").val("1")
			}else if($(this).attr("src") == "../addons/haoman_dpm/img12/woman.png"){
				$(this).attr("src",'../addons/haoman_dpm/img12/man.png');
				$(".sex").val("1")
                $(".tokens").val("1")
			}
		});
	</script>
	<script type="text/javascript">
	$(function(){

		$(".signin-btn").click(function(){

		{if $reply['ziliao']!=1}

			var mobile ='';
			var address ='';

			if(($(".nickname").val()=="")||($(".nickname").val()=="null")){
				$(".error_dialog p").html("请填写姓名！");
				$(".error_dialog").show();
				setTimeout(function(){$(".error_dialog").hide()},3000);
				return;
			}
			
			{if $reply['ziliao']==2 || $reply['ziliao']==3}

			if(($(".mobile").val()=="")||($(".mobile").val()=="null")){
				$(".error_dialog p").html("请填写手机号！");
				$(".error_dialog").show();
				setTimeout(function(){$(".error_dialog").hide()},3000);
				return;
			}
			mobile = $("input[name='mobile']").val();
			{/if}
			
			{if $reply['ziliao']==3}
			if(($("#address").val()=="")||($("#address").val()=="null")){
				$(".error_dialog p").html("请填写公司！");
				$(".error_dialog").show();
				setTimeout(function(){$(".error_dialog").hide()},3000);
				return;
			}
			address = $("input[name='address']").val();
			{/if}

		{/if}

			var $btn = $(this);
			if($btn.hasClass("disabled")) return;
			$btn.addClass("disabled");


			var submitData = {
                "tokens":$(".tokens").val(),
                {if $reply['ziliao']!=1}
				"realname":$("input[name='realname']").val(),
					"sex":$("input[name='sex']").val(),
				"mobile":mobile,
				"address":address,
				"nickname":'{$nickname}',
				"avatar":'{php echo tomedia($avatar)}'
				{else}
				"nickname":'{$nickname}',
					"sex":$("input[name='sex']").val(),
				"avatar":'{php echo tomedia($avatar)}'
				{/if}

            };
            $.post('{php echo $this->createMobileUrl('ckinfo',array('id'=>$rid,'from_user'=>$page_from_user))}', submitData, function(idata) {
               $btn.removeClass("disabled");
				if (idata.success == 1) {
					$(".signIned").show();
					$(".cover").show();
				}else if(idata.success==200){
					$(".tel_cover").show();
				}
				else{
					$(".error_dialog p").html(idata.msg);
					$(".error_dialog").show();
					setTimeout(function(){$(".error_dialog").hide()},3000);
					return;
				}
            },"json");

		    
		});
	});

	function onChecks(){
		$(".tel_cover").hide();
	}

	function onCheck(){
		{if $reply['ziliao']!=1}

		var mobile ='';
		var address ='';

		if(($(".nickname").val()=="")||($(".nickname").val()=="null")){
			$(".error_dialog p").html("请填写姓名！");
			$(".error_dialog").show();
			setTimeout(function(){$(".error_dialog").hide()},3000);
			return;
		}

		{if $reply['ziliao']==2 || $reply['ziliao']==3}

		if(($(".mobile").val()=="")||($(".mobile").val()=="null")){
			$(".error_dialog p").html("请填写手机号！");
			$(".error_dialog").show();
			setTimeout(function(){$(".error_dialog").hide()},3000);
			return;
		}
		mobile = $("input[name='mobile']").val();
		{/if}

		{if $reply['ziliao']==3}
		if(($(".address").val()=="")||($(".address").val()=="null")){
			$(".error_dialog p").html("请填写公司！");
			$(".error_dialog").show();
			setTimeout(function(){$(".error_dialog").hide()},3000);
			return;
		}
		address = $("input[name='address']").val();
		{/if}

		{/if}

		var $btn = $(this);
		if($btn.hasClass("disabled")) return;
		$btn.addClass("disabled");

		var submitDatas = {
		{if $reply['ziliao']!=1}
		        "realname":$("input[name='realname']").val(),
		        "sex":$("input[name='sex']").val(),
				"mobile":mobile,
				"address":address,
				"nickname":'{$nickname}',
				"avatar":'{php echo tomedia($avatar)}',
		{else}
		        "nickname":'{$nickname}',
				"sex":$("input[name='sex']").val(),
				"avatar":'{php echo tomedia($avatar)}',
		{/if}
        "tokens":$(".tokens").val()
	};
		$.post('{php echo $this->createMobileUrl('confirm',array('id'=>$rid,'from_user'=>$page_from_user))}', submitDatas, function(idata) {
			$btn.removeClass("disabled");
			if (idata.success == 1) {
				//  alert(idata.orderid);
				location.href="{php echo $this->createMobileUrl('pay')}&orderid="+idata.orderid;
			} else {
				alert(idata.msg);
			}
		},"json");

	}
</script>
</div>
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
	wx.config({
		debug:false,
		appId: '{$package["appId"]}',
		timestamp: '{$package["timestamp"]}',
		nonceStr: '{$package["nonceStr"]}',
		signature: '{$package["signature"]}',
		jsApiList: [
			'checkJsApi','getLocation','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareWeibo'
	]
	});
	var sharedata = {
		"imgUrl" : "{$shareimg}",
		"link" : "{$sharelink}",
		"desc" : "{$sharedesc}",
		"title" : "{$sharetitle}"
	};

	wx.ready(function () {
		{if $reply['is_b_share'] == 2}
		wx.hideOptionMenu();
		{else}
		wx.showOptionMenu();
		wx.onMenuShareAppMessage(sharedata);
		wx.onMenuShareTimeline(sharedata);
		wx.onMenuShareQQ(sharedata);
		wx.onMenuShareQZone(sharedata);
		wx.onMenuShareWeibo(sharedata);
		{/if}
	});

</script>
<script>
	function is_close() {
		WeixinJSBridge.invoke('closeWindow',{},function(res){});
		return false;
	}

</script>
</html>